home *** CD-ROM | disk | FTP | other *** search
- unit calunit;
-
- interface
-
- uses Windows, Classes, Graphics, Forms, Controls, Menus,
- Dialogs, StdCtrls, Buttons, ExtCtrls, ComCtrls, CalComp, shellapi;
-
- const
- crHandCur = 8888;
-
- type
- TAppForm = class(TForm)
- CalComp1: TCalComp;
- Edit1: TEdit;
- Label1: TLabel;
- Button1: TButton;
- Label2: TLabel;
- Edit2: TEdit;
- Button2: TButton;
- CalComp2: TCalComp;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure Label3Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- AppForm: TAppForm;
-
- implementation
-
- uses SysUtils;
-
- {$R *.DFM}
- {$R CALCURS.RES}
-
- procedure TAppForm.Button1Click(Sender: TObject);
- var
- s:string[10];
- begin
- with calcomp1 do
- begin
- s:=edit1.text;
- month:=strtoint(copy(s,1,pos('-',s)-1));
- delete(s,1,pos('-',s));
- day:=strtoint(copy(s,1,pos('-',s)-1));
- delete(s,1,pos('-',s));
- year:=strtoint(s);
-
- if execute then
- begin
- edit1.text:=inttostr(month)+'-'+inttostr(day)+'-'+inttostr(year);
- label6.caption:=inttostr(calcomp1.week);
- end;
- end;
- end;
-
- procedure TAppForm.Button2Click(Sender: TObject);
- var
- s:string[10];
- begin
- with calcomp2 do
- begin
- s:=edit2.text;
- month:=strtoint(copy(s,1,pos('-',s)-1));
- delete(s,1,pos('-',s));
- day:=strtoint(copy(s,1,pos('-',s)-1));
- delete(s,1,pos('-',s));
- year:=strtoint(s);
-
- if execute then
- begin
- edit2.text:=inttostr(month)+'-'+inttostr(day)+'-'+inttostr(year);
- label7.caption:=inttostr(calcomp2.week);
- end;
- end;
- end;
-
- procedure TAppForm.FormCreate(Sender: TObject);
- var
- da,mo,ye:word;
- begin
- decodedate(now,ye,mo,da);
- edit1.text:=inttostr(mo)+'-'+inttostr(da)+'-'+inttostr(ye);
- edit2.text:=edit1.text;
-
- Screen.Cursors[crHandCur] := LoadCursor(HInstance,PChar(8888));
- Label3.cursor:=crHandCur;
- end;
-
- procedure TAppForm.Label3Click(Sender: TObject);
- begin
- ShellExecute(Application.Handle,'open','http://www.ven.be/freestyle/delphi.htm', nil, nil, SW_NORMAL);
- end;
-
- end.
-
-